<?php
/**
 *   经销商采购订单明细
*/

namespace app\api\model;

class WholesalOrderItem extends BaseModel
{

    protected $name = 'order_item';
    /**
     *  关联产品
     */
    public function product(){
        return $this->hasOne('Product','id','product_id');
    }

    /**
     *  管理库存表
     */
    public function inventory()
    {
        return $this->hasOne('Inventory', 'id', 'inventory_id');
    }


    /**
     *  管理仓库
    */
    public function warehouse()
    {
        return $this->hasOne('Warehouse', 'id', 'warehouse_id');
    }

    /**
     *  关联订单
     */
    public function orderInfo()
    {
        return $this->hasOne(WholesalOrder::class, 'id', 'order_id');
    }


}
